Loading Animation - #178
Conversation
Bring the loading animation branch up to date with main (24 commits behind). Resolved conflicts: - User.swift, MainViewModel.swift: kept main's versions. The WIP workarounds (hardcoded goal value, commented-out User init) were only needed because the branch's .graphql files were stale. - mountain_back / mountain_front Contents.json: kept main's filenames. - project.pbxproj: kept both sides so IntroAnimationView.swift stays in the target alongside main's new files. This also fixes the "Missing package product" build errors: the old UserMutations.graphql declared workoutGoal as [String]! while the backend expects Int!, so Apollo codegen failed and UpliftAPI/Package.swift was never generated.
…into anatoli/loading-animation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
JiwonJeong414
left a comment
There was a problem hiding this comment.
Nice work Kaylee! Just a couple of comments to consider 👍
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "intro_background.png", |
There was a problem hiding this comment.
do we not have 2x 3x files for this? you need the 2x 3x file so that the photo does not get blurry. also do we use png for our assets or svgs can you check the other files?
There was a problem hiding this comment.
it looks like pngs inside of Assets.xcassets
| .offset(y: animateElements ? 0 : 200) | ||
| .animation(.smooth(duration: 2), value: animateElements) | ||
|
|
||
| Color.clear // to give enough space for logo! |
| @StateObject private var loginViewModel = LoginViewModel() | ||
| @State private var animateElements: Bool = false | ||
| @State private var showIntro = !SignInView.hasShownIntro | ||
|
|
There was a problem hiding this comment.
hmmm, this looks like state logic don't you think we can do something like
enum Phase {
case hidden
case entered
case transitioningToSignIn
case finished
}
There was a problem hiding this comment.
You could either make this @observable or define it through your 2nd view model
|
|
||
| // MARK: - Helpers | ||
|
|
||
| // logo properties |
There was a problem hiding this comment.
there's a lot of magic numbers (constants) that should be put into the constants file
| // MARK: - Helpers | ||
|
|
||
| // logo properties | ||
| private var mainLogoSize: CGSize { |
There was a problem hiding this comment.
I actually think here is a good structure to try utilizing two view models try adding this @State private var animationViewModel = SignInAnimationViewModel() at the top and adding all these private vars and private func, good separation of concerns
|
|
||
| // MARK: - Views | ||
|
|
||
| private var backgroundImage: some View { |
There was a problem hiding this comment.
weird tab delete the tab starting from line 59
| ) | ||
| } | ||
|
|
||
| // MARK: - Helpers |
There was a problem hiding this comment.
same here I feel like you could have a 2nd viewmodel for the animations try it and see if you like the 2nd viewmodel architecture
| guard height > 0 else { return } | ||
|
|
||
| DispatchQueue.main.async { | ||
| hasEntered = true |
There was a problem hiding this comment.
same here let's not use Dispatchqueue
|
|
||
| onTransition?() | ||
|
|
||
| DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) { |
| hasEntered = true | ||
|
|
||
| DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { | ||
| withAnimation(.smooth(duration: 0.35)) { |
JiwonJeong414
left a comment
There was a problem hiding this comment.
Nice Kaylee! I made a few more comments but I'm trusting you to fix them before merging. BTW you can track which comments you addressed by resolving them, it's easier for me to see as well the progress you are making.
There was a problem hiding this comment.
This file is the same size as one above this looks sus 3x should have a file size bigger than the 2x
There was a problem hiding this comment.
same here these are all the same size. in the figma there should be a way to export 2x, 3x of an asset
| /// Constants used in IntroAnimation | ||
| enum IntroAnimation { | ||
| static let entranceDuration: Double = 1.0 | ||
| static let entranceDelay: Double = 0.1 |
Overview
Implemented loading animation according to design
Collaborated with Anatoli: I worked on adding the background image, animating the Uplift logo, and linking the intro animation to SignInView with a transition
Added state inside of SignInView to behave differently on the user's first open of the app to show the loading animation + animate the logo differently. It should not appear in any other use of SignInView (like on the profile)
Video
Screen.Recording.2026-09-09.at.10.43.36.PM.mov